{% extends "base.html" %}
{% block title %}首页{% endblock %}

{% block content %}
<section class="banner">
    <div class="banner-content">
        <h2>深夜阅读，灵魂的独处时光</h2>
        <p>在寂静的夜晚，与一本好书相遇</p>
    </div>
</section>

<section class="book-section">
    <h2><i class="fas fa-fire"></i> 热门书籍</h2>
    <div class="book-grid">
        {% for book in books %}
        <div class="book-card">
            <div class="book-cover">
                <img src="{{ url_for('static', filename=book.image_path) }}" alt="{{ book.title }}">
            </div>
            <div class="book-info">
                <h3>{{ book.title }}</h3>
                <p class="category"><i class="fas fa-tag"></i> {{ book.category }}</p>
                <a href="{{ url_for('download', book_id=book.id) }}" class="download-btn">
                    <i class="fas fa-download"></i> 下载
                </a>
            </div>
        </div>
        {% endfor %}
    </div>
</section>

<section class="categories">
    <h2><i class="fas fa-th-large"></i> 书籍分类</h2>
    <div class="category-grid">
        <div class="category-card sci-fi">
            <i class="fas fa-rocket"></i>
            <h3>科幻小说</h3>
        </div>
        <div class="category-card literature">
            <i class="fas fa-pen-fancy"></i>
            <h3>现当代文学</h3>
        </div>
        <div class="category-card history">
            <i class="fas fa-landmark"></i>
            <h3>历史</h3>
        </div>
        <div class="category-card foreign">
            <i class="fas fa-globe-asia"></i>
            <h3>外国文学</h3>
        </div>
    </div>
</section>
{% endblock %}